﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Intorise.Common
{
    public class SmartTimer : System.Windows.Forms.Timer
    {
        DateTime start;

        public new void Start()
        {
            base.Start();
        }

        /// <summary>
        /// 开始计时
        /// </summary>
        public void BeginTimer()
        {
            start = DateTime.Now;
        }

        /// <summary>
        /// 返回自从上一次开始计时到现在过去的时间
        /// </summary>
        /// <returns></returns>
        public TimeSpan GetUsedTime()
        {
            return DateTime.Now - start;
        }
    }
}
